﻿using System;
using System.Collections.Generic;
using System.Text;

 
using Gx.Model.Entity;//实体
using Gx.Common;//通用类
using Gx.Dal.Employee;

namespace Gx.Bll.Employee
{
    public class G_PurchaseOrderPriceInfoBll
    {
        public bool AddG_PurchaseOrderPriceInfo(G_PurchaseOrderPriceInfo model)
        {
            using (G_PurchaseOrderPriceInfoDal dal = new G_PurchaseOrderPriceInfoDal())
            {
                return dal.AddG_PurchaseOrderPriceInfo(model);
            }
        }

        public bool DelG_PurchaseOrderPriceInfo(int stockInPriceId)
        {
            using (G_PurchaseOrderPriceInfoDal dal = new G_PurchaseOrderPriceInfoDal())
            {
                return dal.DelG_PurchaseOrderPriceInfo(stockInPriceId);
            }
        }

        public bool EditG_PurchaseOrderPriceInfo(G_PurchaseOrderPriceInfo model)
        {
            using (G_PurchaseOrderPriceInfoDal dal = new G_PurchaseOrderPriceInfoDal())
            {
                return dal.EditG_PurchaseOrderPriceInfo(model);
            }
        }

        private List<G_PurchaseOrderPriceInfo> GetG_PurchaseOrderPriceInfoList(string strWhere)
        {
            using (G_PurchaseOrderPriceInfoDal dal = new G_PurchaseOrderPriceInfoDal())
            {
                return dal.GetG_PurchaseOrderPriceInfoList(strWhere);
            }
        }

        public List<G_PurchaseOrderPriceInfo> GetG_PurchaseOrderPriceInfoList(
        int pageIndex, int pageSize, out int totalCount)
        {
            using (G_PurchaseOrderPriceInfoDal dal = new G_PurchaseOrderPriceInfoDal())
            {
                int PageIndex = (pageIndex - 1) * pageSize + 1;
                int PageSize = pageIndex * pageSize;
                StringBuilder strWhere = new StringBuilder();
                return dal.GetG_PurchaseOrderPriceInfoList(strWhere.ToString(), PageIndex, PageSize, out totalCount);
            }
        }

        private int GetG_PurchaseOrderPriceInfoCount(string strWhere)
        {
            using (G_PurchaseOrderPriceInfoDal dal = new G_PurchaseOrderPriceInfoDal())
            {
                return dal.GetG_PurchaseOrderPriceInfoCount(strWhere);
            }
        }

        public G_PurchaseOrderPriceInfo GetG_PurchaseOrderPriceInfoModel(int stockInPriceId)
        {
            using (G_PurchaseOrderPriceInfoDal dal = new G_PurchaseOrderPriceInfoDal())
            {
                return dal.GetG_PurchaseOrderPriceInfoModel(stockInPriceId);
            }
        }
    }
}
